package com.ym.controller.soso;

import com.github.pagehelper.PageInfo;
import com.ym.common.constant.Constants;
import com.ym.common.utils.page.PageDomain;
import com.ym.core.annotation.Log;
import com.ym.core.domain.APIResponse;
import com.ym.core.domain.BaseController;
import com.ym.soso.domain.entity.SveNoseHouseEntity;
import com.ym.soso.domain.param.SveNoseHouseSimQueryParam;
import com.ym.soso.domain.vo.SveNoseHouseSimVO;
import com.ym.soso.service.ISveNoseHouseSV;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 鼻炎馆Controller
 *
 * @author ym
 * @date 2020-03-06
 */
@Api(tags = "app-鼻炎馆")
@RestController("AppSveNoseHouseController")
@Validated
@RequestMapping(value = "/soso/house", headers = Constants.Api.VERSION)
public class SveNoseHouseController extends BaseController {

	@Autowired
	private ISveNoseHouseSV sveNoseHouseSV;

	@ApiOperation("查询鼻炎馆列表")
	@Log(dataBase = false, printBody = false, printQuery = true)
	@GetMapping("/list")
	public APIResponse<PageInfo<SveNoseHouseSimVO>> list(@Valid SveNoseHouseSimQueryParam queryParam) {
		PageDomain.startPage();
		List<SveNoseHouseSimVO> list = sveNoseHouseSV.selectListMobile(queryParam);
		return successPage(list);
	}

	@ApiOperation("获取鼻炎馆详细信息")
	@Log(dataBase = false, printBody = false, printQuery = true)
	@GetMapping(value = "/info")
	public APIResponse<SveNoseHouseEntity> info(@RequestParam Long id) {
		SveNoseHouseEntity data = sveNoseHouseSV.selectById(id);
		return successData(data);
	}

}
